<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <title>教学产品-获取线索信息</title>
    <meta content="Admin Dashboard" name="description" />
    <meta content="Mannatthemes" name="author" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link href="/common/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/common/assets/css/icons.css" rel="stylesheet" type="text/css">
    <link href="/common/assets/css/style.css" rel="stylesheet" type="text/css">

</head>
<body>
<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <form id="f1" action="/com/imelite/qyh/EliteView_YyxxAction/ajax_getYyxxByForm.do">
                    <input type="hidden" name="iddep" value="${iddep}">
                    <div class="form-group row">
                        <label for="example-text-input" class="col-sm-2 col-form-label">客户预约的电话号码</label>
                        <div class="col-sm-8">
                            <input class="form-control" type="text" value="${stuph}" name="stuph" id="example-text-input">
                        </div>
                        <div class="col-sm-2">
                            <button id="selectBtn" type="button" class="btn btn-primary waves-effect waves-light">查询</button>
                        </div>
                    </div>
                </form>

                <table class="table">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>实际到访时间</th>
                        <th>指定顾问</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="yyxxlist">
                        <c:forEach var="item" items="${yyxxList}">
                            <tr>
                                <td>${item.xssname}</td>
                                <td>${item.stuph}</td>
                                <td>${item.sjqdrqfmt}</td>
                                <td>
                                    <select class="form-control" onchange="changeSC('${item.id}',this)">
                                        <option value="">--</option>
                                        <c:forEach var="sc_cd" items="${sc_cdlist}">
                                        <option <c:if test="${sc_cd.id==item.idowner}"> selected </c:if> value="${sc_cd.id}">${sc_cd.sname}</option>
                                        </c:forEach>

                                    </select>
                                </td>
                                <td><button onclick="jxcp('${item.id}')" type="button" class="btn btn-success waves-effect waves-light">进行测评</button></td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div> <!-- end col -->
</div> <!-- end row -->

<form id="f2" action="/com/imelite/qyh/JxcpcsAction/getTestPage.do" method="post">
    <input id="iddep" type="hidden" name="iddep" value="${iddep}">
    <input id="yyxxid" type="hidden" name="yyxxid">
</form>
<!-- jQuery  -->
<script src="/common/assets/js/jquery.min.js"></script>
<script src="/common/assets/js/popper.min.js"></script>
<script src="/common/assets/js/bootstrap.min.js"></script>
<script src="/common/assets/js/modernizr.min.js"></script>
<script src="/common/assets/js/waves.js"></script>
<script src="/common/assets/js/jquery.slimscroll.js"></script>
<script src="/common/assets/js/jquery.nicescroll.js"></script>
<script src="/common/assets/js/jquery.scrollTo.min.js"></script>
<!-- App js -->
<script src="/common/assets/js/app.js"></script>
<script>
    $('#selectBtn').click(function(){
        $('#f1').submit();
    });

    function jxcp(yyxxid){
        $('#yyxxid').val(yyxxid);
        $('#f2').submit();
    }

    function changeSC(yyxxid,obj){
        $.ajax({
            type: "post",
            url: "/com/imelite/qyh/EliteView_YyxxAction/update_idowner.do",
            data: {
                id:yyxxid,
                idowner:obj.value
            },
            success: function (data) {
                window.location.reload();
            },
            error: function () {
                alert("发生异常");
            }
        });
    }
</script>

</body>
</html>